<template>
  <div class="blocks">
    <el-carousel trigger="click" arrow="always">
      <el-carousel-item v-for="item in ItemBanner" :key="item.id">
        <h3 class="small">
          <img :src="item.imgUrl" alt="" />
        </h3>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import { banner } from "../api/user";
export default {
  name: "HomeBanner",
  data() {
    return {
      ItemBanner: [],
    };
  },
  mounted() {
    banner().then((res) => {
      this.ItemBanner = res.data.result;
    });
  },
};
</script>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}

.el-carousel__item {
  height: 500px !important;
}

.blocks {
  width: 1240px !important;
  height: 500px !important;
  margin: 0 auto;
}

.el-carousel--horizontal {
  overflow: hidden !important;
  height: 500px !important;
}


.el-carousel__container {
    position: relative !important;
    height: 500px !important;
}



</style>